package ve.ejb.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.log4j.Category;

/**
 *
 * @author memozac
 */
@Entity
public class ScoreCardCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idScoreCardCategory;

    @ManyToOne
    @JoinColumn(name="idScoreCard",nullable=false,updatable=true)
    private ScoreCard scoreCard;

    @ManyToOne
    @JoinColumn(name="idCategory",nullable=false,updatable=true)
    private Category category;

    @Temporal(value = TemporalType.TIMESTAMP) private Date registerDate;

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
    
    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Long getIdScoreCardCategory() {
        return idScoreCardCategory;
    }

    public void setIdScoreCardCategory(Long idScoreCardCategory) {
        this.idScoreCardCategory = idScoreCardCategory;
    }

    public ScoreCard getScoreCard() {
        return scoreCard;
    }

    public void setScoreCard(ScoreCard scoreCard) {
        this.scoreCard = scoreCard;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idScoreCardCategory != null ? idScoreCardCategory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof ScoreCardCategory)) {
            return false;
        }
        ScoreCardCategory other = (ScoreCardCategory) object;
        if ((this.idScoreCardCategory == null && other.idScoreCardCategory != null) || (this.idScoreCardCategory != null && !this.idScoreCardCategory.equals(other.idScoreCardCategory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.ejb.entity.ScoreCardCategory[id=" + idScoreCardCategory + "]";
    }

}//ends of class
